//
//  DeletableTableViewCell.h
//  DeletableTableCell
//
//  Created by nhn on 12/30/14.
//  Copyright (c) 2014 CNUIC. All rights reserved.
//

#import <UIKit/UIKit.h>

@class DeletableTableViewCell;

@protocol DeletableableViewCellDelegate <NSObject>
- (NSUInteger)numberOfItmesInDeletableCell:(DeletableTableViewCell*)cell;
- (UIImage*)deletableCell:(DeletableTableViewCell*)cell imageForIndex:(NSUInteger)index;
- (BOOL)deletableCell:(DeletableTableViewCell*)cell shouldDeleteItemAtIndex:(NSUInteger)index;
- (void)deletableCell:(DeletableTableViewCell*)cell didDeleteItemAtIndex:(NSUInteger)index;
- (void)deletableCell:(DeletableTableViewCell*)cell didSelectItemAtIndex:(NSUInteger)index;
- (void)deletableCell:(DeletableTableViewCell*)cell deleteBeginOrEnd:(BOOL)begin;
@end

@interface DeletableTableViewCell : UITableViewCell

@property (nonatomic, strong) NSMutableArray* cellArray;
@property (nonatomic, weak) id<DeletableableViewCellDelegate> delegate;
@property (nonatomic, assign) UIEdgeInsets edgeInset;
@property (nonatomic, assign) CGFloat rowSpace;
@property (nonatomic, assign) CGSize cellSize;
@property (nonatomic, assign) CGFloat cellSpace;
@property (nonatomic, assign) NSUInteger cellPerRow;
@property (nonatomic, assign) BOOL isDeleting;

- (CGFloat)recalcLayout;
- (void)reloadData;
- (void)startDelete;
- (void)stopDelete;

@end
